Skip to content

Feat: add oauth2 support for Jira toolkit #30684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pol-defont-reaulx
Copy link
Contributor

Description: add support for oauth2 in Jira tool by adding the possibility to pass a dictionary with oauth parameters. I also adapted the documentation to show this new behavior

Copy link

vercel bot commented Apr 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2025 6:38pm

@@ -14,6 +14,7 @@ class JiraAPIWrapper(BaseModel):
confluence: Any = None
jira_username: Optional[str] = None
jira_api_token: Optional[str] = None
jira_oauth_dict: Optional[Union[Dict[str, Union[str, Dict[str, str]]], str]] = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. dict isn't a good thing to put in this variable name. Perhaps jira_oauth2 to indicate it's just proxying the oauth2 variable?
  2. Could you document inline what values are accepted? And explicit type annotation for the dict using a TypedDict (typing_extensions import TypedDict) would help!
  3. Now that there's more than one option to authenticate, it would be good to document this as part of the wrapper -- you could add an authentication example in the JiraAPIWrapper and inline a doc-string for both variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it what you had in mind?

Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! happy to merge after:

  1. update variable name
  2. adding documentation

@eyurtsev eyurtsev self-assigned this Apr 9, 2025
"""Jira OAuth2 token type ('bearer' or other)."""


class JiraOauth2(TypedDict):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typing_extensions.TypedDict might be needed w/ pydantic and python < 3.12

@dosubot dosubot bot added the lgtm label Apr 11, 2025
@eyurtsev eyurtsev merged commit 48cf7c8 into langchain-ai:master Apr 11, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants